<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../../Template/generalTemplate.xhtml">

            <ui:define name="content">

                <h:form id="form">

                    <p:panel id="OrderTable" header="Orders Detail" style="height:495px;">

                        <div style="margin-left: 20px;margin-right: 20px;">
                            <p:wizard showStepStatus="false"  widgetVar="wiz" style="height:450px;" flowListener="#{generateOrdersManagedBean.onFlowProcess}">
                                <p:tab title="1" id="pickingOrder">
                                    <h3>
                                        <h:outputText value="Picking Order" />
                                    </h3>
                                    <h:outputText value="Picking Order Id"/>
                                    <h:outputText value="#{generateOrdersManagedBean.selectedDeliveryOrder.pickingOrder.id}"/>
                                    <br></br>
                                    <h:outputText value="Source Delivery Order Id"/>
                                    <h:outputText value="#{generateOrdersManagedBean.selectedDeliveryOrder.id}"/>
                                    <br></br>
                                    <h:outputText value="Generate Date"/>
                                    <h:outputText value="#{generateOrdersManagedBean.selectedDeliveryOrder.generateDate}"/>
                                    <br></br>   
                                    <h:outputText value="Delivery Date"/>
                                    <h:outputText value="#{generateOrdersManagedBean.selectedDeliveryOrder.deliveryDate}"/>
                                    <br></br> 
                                    <p:dataTable id="pickingOrderLineItem" dynamic="true" emptyMessage="No Item to display" value="#{generateOrdersManagedBean.selectedDeliveryOrder.deliveryOrderLineItems}" var ="lineItems">
                                        <p:column>
                                            <f:facet name="header">Product Name</f:facet>
                                            #{lineItems.product.productName}
                                        </p:column>

                                        <p:column>
                                            <f:facet name="header">Required Quantity</f:facet>
                                            #{lineItems.quantity}
                                        </p:column>

                                        <p:column>
                                            <f:facet name="header">Pick Up Location</f:facet>
                                            #{lineItems.product.warehouseLocation}
                                        </p:column>
                                    </p:dataTable>
                                    <br />
                                    <h:outputLink id="lnk" value="Print">  
                                        <p:printer target="pickingOrder" />  
                                        <p:graphicImage value="/images/document-print.png" style="height:25px; width:25px;" />  
                                    </h:outputLink>   

                                </p:tab>

                                 <p:tab title="2" id="packingOrder">
                                    <h3>
                                        <h:outputText value="Packing Order" />
                                    </h3>
                                    <h:outputText value="Packing Order Id"/>
                                    <h:outputText value="#{generateOrdersManagedBean.packingOrder.id}"/>
                                    <br></br>
                                    <h:outputText value="Source Delivery Order Id"/>
                                    <h:outputText value="#{generateOrdersManagedBean.packingOrder.deliveryOrder.id}"/>
                                    <br></br>
                                    <h:outputText value="Generate Date"/>
                                    <h:outputText value="#{generateOrdersManagedBean.packingOrder.generateDate}"/>
                                    <br></br>   
                                    <h:outputText value="Delivery Date"/>
                                    <h:outputText value="#{generateOrdersManagedBean.packingOrder.deliveryOrder.deliveryDate}"/>
                                    <br></br> 
                                    <p:dataTable id="packingOrderLineItem" dynamic="true" emptyMessage="No Item to display" value="#{generateOrdersManagedBean.packingOrder.deliveryOrder.deliveryOrderLineItems}" var ="lineItems">
                                        <p:column>
                                            <f:facet name="header">Product Name</f:facet>
                                            #{lineItems.product.productName}
                                        </p:column>

                                        <p:column>
                                            <f:facet name="header">Required Quantity</f:facet>
                                            #{lineItems.quantity}
                                        </p:column>

                                      
                                    </p:dataTable>
                                    <br />
                                    <h:outputLink id="lnk2" value="Print">  
                                        <p:printer target="packingOrder" />  
                                        <p:graphicImage value="/images/document-print.png" style="height:25px; width:25px;" />  
                                    </h:outputLink>   

                                </p:tab>
                                  <p:tab title="3" id="shippingOrder">
                                    <h3>
                                        <h:outputText value="Shipping Order" />
                                    </h3>
                                    <h:outputText value="Shipping Order Id"/>
                                    <h:outputText value="#{generateOrdersManagedBean.shippingOrder.id}"/>
                                    <br></br>
                                    <h:outputText value="Source Delivery Order Id"/>
                                    <h:outputText value="#{generateOrdersManagedBean.shippingOrder.deliveryOrder.id}"/>
                                    <br></br>
                                    <h:outputText value="Generate Date"/>
                                    <h:outputText value="#{generateOrdersManagedBean.shippingOrder.generateDate}"/>
                                    <br></br>   
                                    <h:outputText value="Delivery Date"/>
                                    <h:outputText value="#{generateOrdersManagedBean.shippingOrder.deliveryOrder.deliveryDate}"/>
                                    <br></br> 
                                    <h:outputText value="Delivery Location"/>
                                    <h:outputText value="#{generateOrdersManagedBean.shippingOrder.deliveryOrder.deliveryLocation}"/>
                                    <br></br> 
                                    <p:dataTable id="shippingOrderLineItem" dynamic="true" emptyMessage="No Item to display" value="#{generateOrdersManagedBean.shippingOrder.deliveryOrder.deliveryOrderLineItems}" var ="lineItems">
                                        <p:column>
                                            <f:facet name="header">Product Name</f:facet>
                                            #{lineItems.product.productName}
                                        </p:column>

                                        <p:column>
                                            <f:facet name="header">Required Quantity</f:facet>
                                            #{lineItems.quantity}
                                        </p:column>

                                        
                                    </p:dataTable>
                                    <br />
                                    <h:outputLink id="lnk3" value="Print">  
                                        <p:printer target="shippingOrder" />  
                                        <p:graphicImage value="/images/document-print.png" style="height:25px; width:25px;" />  
                                    </h:outputLink>   

                                </p:tab>

                            </p:wizard>
                        </div> 
                    </p:panel>

                </h:form>

            </ui:define>


        </ui:composition>

    </body>
</html>

